package com.zjs.backup.contorller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
public class TestContorller {

    @GetMapping(value = "/timeOut/{s}")
    public String timeOut(@PathVariable(value = "s") int s){
        try {
            Thread.sleep(s*1000);
            System.out.println("延迟"+s+" S "+new Date());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "从MongoDB 延迟"+s+" S "+new Date();
    }
}
